#! /bin/sh

cat <<EOF
`echo "(1) basecenter"`
`echo "(2) maindatacenter"`
`echo "(3) operatecenter"`
`echo "(4) businessapp"`
`echo "(0) quit"`
EOF

download_image() {
  echo "Download image of ${1}..."
  wget "http://0.0.0.0:8088/files/${1}.jar"
}

read -p "Please input service number": num
case $num in
  (1)
  download_image basecenter
  ;;
  (2)
  download_image maindatacenter
  ;;
  (3)
  download_image operatecenter
  ;;
  (4)
  download_image businessapp
  ;;
  (0)
  exit 0
esac
